package org.example.fanruan;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * @author Yyming
 * @version 10.0
 * Created by Yyming on 2021/3/26
 */
public class MaxGongYueShu {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        BigInteger a = new BigInteger(in.next());
        BigInteger b = new BigInteger(in.next());
        a.gcd(b);
    }
}
